<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=yes" />
	<title><%= htmlWebpackPlugin.options.title %></title>
	<% for (var css in htmlWebpackPlugin.files.css) { %>
	<link href="<%=htmlWebpackPlugin.files.css[css] %>" rel="stylesheet">
	<% } %>
	<style>
		.mditor {
			margin: 45px auto;
			max-width: 880px;
		}
		
		#editor {
			display: none;
		}
	</style>
</head>

<body>

	<div>
		<textarea id="editor">## 只求极致
[ **M** ] arkdown + E [ **ditor** ] = **Mditor**  
> Mditor 是一个简洁、易于集成、方便扩展、期望舒服的编写 markdown 的编辑器，仅此而已...</textarea>
	</div>

	<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
	<script src="<%=htmlWebpackPlugin.files.chunks[chunk].entry %>"></script>
	<% } %>
	<script>
		var textarea = document.getElementById('editor');
		var mditor = Mditor.fromTextarea(textarea);
		mditor.on('ready',function(){
			console.log('mditor', mditor);
			console.log('toolbar', mditor.toolbar);
			mditor.on('changed', function(){
				//console.log('changed',mditor.value);
			});
			mditor.editor.on('drop',function(event){
				console.log('drop',event);
			});
			mditor.editor.on('paste',function(event){
				console.log('paste',event.clipboardData.types);
			});
			mditor.on('head-dblclick',function(){
				console.log('head-dblclick');
			});
		});
	</script>
</body>

</html>